home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15092 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.3 KB

  1. Path: seas.gwu.edu!ckann
  2. From: ckann@seas.gwu.edu (Charles W. Kann)
  3. Newsgroups: comp.lang.c++,comp.lang.java
  4. Subject: Re: Java: What's the Big Deal?
  5. Followup-To: comp.lang.c++,comp.lang.java
  6. Date: 3 Apr 1996 16:27:48 GMT
  7. Organization: George Washington University
  8. Message-ID: <4ju8u4$h4u@cronkite.seas.gwu.edu>
  9. References: <milodDoF9JF.K32@netcom.com> <1996Mar20.154600.12011@amc.com>  <3160AB73.6653@www.nwho.com>
  10. NNTP-Posting-Host: 128.164.9.3
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Jan & Gord Wait (nwho@www.nwho.com) wrote:
  14. : Pohl Longsine wrote:
  15. : > 
  16. : > In <milodDoL1uy.581@netcom.com> John DiCamillo wrote:
  17. : > > curtis@amc.com (Curtis Green) writes:
  18. : > > >John DiCamillo (milod@netcom.com) wrote:
  19. : > > >: pete@borland.com (Pete Becker) writes:
  20. : > >
  21. : > > >: >There's no reason you can't write a C++ compiler that generates a Java
  22. : > > >: >bytestream.
  23. : > >
  24. : > > >: Are you claiming that arbitrary, correct (ANSI) C++ code can
  25. : > > >: be compiled to the JVM and continue to work correctly?
  26. : > 
  27. : > Since Java is based upon a VM with an "instruction set" one could write a
  28. : > compiler for any language, the output for which is the "object code" of the
  29. : > VM.   (Unless there's some design flaw in the VM architecture that I'm
  30. : > unaware of.)
  31. : > 
  32. : > Any compiler gurus out there that can explain why I might be wrong here?
  33. : > --
  34. : > pohl@screaming.org
  35. : > http://mmm.screaming.org/
  36.  
  37. : It might not be impossible, but it wouldn't be trivial: C and C++ support
  38. : direct address pointers, that usually end up as address references in machine
  39. : language (which is why C and C++ can be fast). Java won't let you get at 
  40. : address pointers, so you would have to build a fake higher level memory system
  41. : in java VM to support the pointers from the C ish source code.. ugghhh..
  42.  
  43. And the nature of strings and arrays would be a problem.  But to my mind
  44. the biggest problem is that C and C++ are not based completly on an object
  45. model.  Free standing subroutines go somewhere, but where?  What if you have
  46. a library of subroutines, does each go into it's own class, or do you
  47. create an class based on the file they are in?
  48.  
  49. This has been my biggest problem using Ada with Java.  What exactly is an
  50. object in Ada?  It is something different than it is in Java.  And the 
  51. modularity of the program is different.  I know that the argument is that
  52. the compiler should translate to something Java understands, and that I
  53. should not worry what that is.  But to my mind understanding a Java program
  54. means understanding how the Java machine is working on the problem.  I
  55. want to know what the classes are.  And what if another compiler chooses a
  56. different naming convention (as in C++ name mangling, which is a problem 
  57. in using different C++ compilers today, and why object code is not portable).
  58. I just am not comfortable with the "compiler should completely hide the 
  59. abstraction" concept, for Java anyway.  A class is just too central a concept.
  60.  
  61. The bottom line is, I think that if you are going to run on a Java VM, 
  62. you need to understand something about how your program looks to the VM.  
  63. This is not completely straight forward even for a language which is closer 
  64. to Java  (such as Ada) than one with an entirely different philosophy 
  65. (such as C).  I think C and C++ compilers would be pretty difficult to use
  66. with Java.
  67.  
  68. --
  69. chuck kann
  70. ckann@seas.gwu.edu
  71.